<%@page import="cn.com.dao.DoctorDao"%>
<%@page import="cn.com.dao.DepartmentsDao"%>
<%@page import="cn.com.dao.ConsumerDao"%>
<%@page import="cn.com.entity.Doctor"%>
<%@page import="cn.com.entity.Departments"%>
<%@page import="cn.com.entity.Consumer"%>
<%@page import="cn.com.entity.Registerform"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理员管理用户挂号单</title>
<style type="text/css">		
a:visited {
	text-decoration: none;
	color: #03C;
}
a:hover {
	text-decoration: none;
	color: #69C;
}
a:active {
	text-decoration: none;
}
a:link {
	
	text-decoration: none;
}
body{
	color: #03C;
	font-size: 20px;
}
</style>
</head>
<body>
<h2 align="center">医院所有预约挂号信息</h2>
<table border="1" width="60%" align="center">
	<tr>
		<td>挂号单序号</td>
		<td>用户姓名</td>
		<td>所挂科室</td>
		<td>所挂医生</td>
		<td>挂号时间</td>
		
	</tr>
<%
	if(session.getAttribute("allregisterform")!=null){
		List<Registerform> list=(List<Registerform>)session.getAttribute("allregisterform");
			for(int i=0;i<list.size();i++){
				Registerform rf=list.get(i);
				int  consumerid=rf.getConsumerid();
				int departmentsid=rf.getDepartmentsid();
				int doctorid=rf.getDoctorid();
				
				Consumer c=new Consumer();
				c.setConsumerid(consumerid);
				ConsumerDao cd=new ConsumerDao();
				Consumer consumer=cd.selectOneConsumer(c);
				
				DepartmentsDao dd=new DepartmentsDao();
				Departments depart=dd.selectOneDepartments(departmentsid);
		
				DoctorDao docd=new DoctorDao();
				Doctor d=docd.selectOneDoctorByid(doctorid);
%>		
	<tr>
		<td><%=i+1 %></td>
		<td><%=consumer.getRealname() %></td>
		<td><%=depart.getDepartmentsname() %></td>
		<td><%=d.getDoctorrealname() %></td>
		<td><%=rf.getRegistertime() %></td>
		
	</tr>
	<%} %>
	<tr><td colspan="5" align="center">共<%=list.size() %>位用户预约挂号</td></tr>
<%} %>
</table>
</body>
</html>